package ahblue.cn.tanzi.model.user;

import android.content.Context;
import android.widget.Toast;

import java.util.List;

import ahblue.cn.tanzi.data.source.ApiCallback;
import ahblue.cn.tanzi.data.source.RemoteRepository;

/**
 * Created by fengdongfei on 2018/12/15.
 */

public class KeChengModel {
    /**
     * id : 41
     * curriculum_title : 如何打造十万文章标题
     * image : https://xmzjvip.b0.upaiyun.com/2018/08/23/449827875upload_android_rkoeeyj2sonj4uuxgz2gj4o00r2ka9wk.JPEG
     * add_time : 1541320188
     * curriculum_price : 200.00
     * user_id : 1
     * member_name : xuping
     */

    public String id;
    public String curriculum_title;
    public String image;
    public String add_time;
    public String curriculum_price;
    public String user_id;
    public String member_name;

    public static void getKeCheng(final Context context , String token, final DataVertifyListener loginListener){
        RemoteRepository repo = RemoteRepository.getsInstance();
        repo.getKeCheng(token, new ApiCallback<List<KeChengModel>>(){
            @Override
            public void onSuccess(List<KeChengModel> data) {
                if (null!=loginListener){
                    loginListener.conver(data);
                }
            }

            @Override
            public void onFailed(String errorMsg) {
                Toast.makeText(context,errorMsg,Toast.LENGTH_LONG).show();
                if (null!=loginListener){
                    loginListener.conver(null);
                }
            }
        });
    }

    public interface DataVertifyListener {
        void conver(List<KeChengModel> data);
    }


}
